#pragma once

#include "TypeTracker.h"

class StackWalker
{
public:
	StackWalker( TypeTracker &typeTracker) : m_TypeTracker(typeTracker) {}
	~StackWalker(void);
	HRESULT WalkStack(CComPtr<ICorProfilerInfo2> pCorProfilerInfo);

	const std::vector<std::wstring> &GetStack() { return m_CurrentStack; }

private:
	TypeTracker &m_TypeTracker;
	CComPtr<ICorProfilerInfo2> m_pCorProfilerInfo;

	std::vector<std::wstring> m_CurrentStack;
	static STDMETHODIMP StackWalkCallback(FunctionID funcId, UINT_PTR ip, COR_PRF_FRAME_INFO frameInfo, ULONG32 contextSize, BYTE context[], void *clientData);
};
